package com.qys.livesMall.app.user.model.dto.sys;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneId;

@Data
public class SysHomeStatisticsDTO implements Serializable {
    @Serial
    private static final long serialVersionUID = -1L;
    @Schema(description = "开始时间")
    private Long startTime;

    @Schema(description = "结束时间")
    private Long endTime;

    @Schema(description = "类型 用户0  店铺 1")
    private Integer type;

    @Schema(description = "用户系统类型（0：水军，1：正常用户）")
    private Integer userSysType;

    public LocalDateTime getStartTime() {
        if (null == startTime){
            return null;
        }
        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(startTime), ZoneId.of("+8"));
        return localDateTime;
    }

    public LocalDateTime getEndTime() {
        if (null == endTime){
            return null;
        }
        endTime= endTime+24*60*60*1000-1;
        LocalDateTime localDateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(endTime), ZoneId.of("+8"));
        return localDateTime;
    }
}
